package com.cashmama.market.api.application.controller.user.request;

import com.cashmama.market.api.infras.utils.ParamsValidateUtil;
import com.cashmama.market.api.infras.utils.StringUtils;
import com.fqgj.common.api.ParamsObject;
import com.fqgj.common.utils.PasswordUtil;

/**
 * @program: market-api
 * @description
 * @author: frank
 * @create: 2020-03-17 22:25
 **/
public class UserPasswordAddRequest extends ParamsObject {

    private String password;

    public String getPassword() {
        return password;
    }

    public UserPasswordAddRequest setPassword(String password) {
        this.password = password;
        return this;
    }

    @Override
    public void validate() {
        ParamsValidateUtil.checkParams(StringUtils.isEmpty(password),"password can not be empty");
        ParamsValidateUtil.checkParams(!PasswordUtil.isPasswordValidate(password),"The password is illegal");
    }
}
